package sqlTestes.criarSqlDeUmaTabela;

import static junit.framework.Assert.assertEquals;
import infra.Cenario;

import org.junit.Test;

import sql.ddl.Tabela;
import sql.ddl.coluna.types.Int4;

public class TabelaCom2Coluna extends Cenario {
	Tabela agua = null;

	public void dadoQue() {
		aTabelaTemNomeAgua();
	}

	public void quando() {
		adcionarAsInteirsColunasAguaEFogo();
	}

	public void entao() {
		oSqlSeraCreateTable__();
		aTabelaTeraDuasColunas();
	}

	public void aTabelaTemNomeAgua() {
		agua = new Tabela("Agua");

	}

	public void adcionarAsInteirsColunasAguaEFogo() {
		agua.addColuna(new Int4("agua", null));
		agua.addColuna(new Int4("fogo", null));

	}

	@Test
	public void oSqlSeraCreateTable__() {
		assertEquals("CREATE TABLE Agua(agua INT4, fogo INT4)", agua
				.codigoSQL());
	}

	@Test
	public void aTabelaTeraDuasColunas() {
		assertEquals(2, agua.getALLColunas().size());
	}
}